<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <script type="text/javascript">
      const _rank = (array) => {
        // 补全代码
        // 请补全JavaScript代码，要求将数组参数中的对象以总成绩(包括属性"chinese"、"math"、"english")从高到低进行排序并返回。
        array.sort((a, b) => {
          let acount =
            parseFloat(a.chinese, 10) +
            parseFloat(a.math, 10) +
            parseFloat(a.english, 10)
          let bcount =
            parseFloat(b.chinese, 10) +
            parseFloat(b.math, 10) +
            parseFloat(b.english, 10)
          return bcount - acount
        })
        return array
      }
    </script>
  </body>
</html>
